<template>
	<div class="hader">
	    <div class="title">请登录</div>
      <i class="logo" @click="C_ctrl"></i>
	</div>
</template>


<script>

import ctrl from '../propsCtrl'     // 兄弟组件之间通信的控制器 中央事件总线

export default {
    data(){
        return {
            ctrlOff: false
        }
    },
    methods: {
        C_ctrl(){
            this.ctrlOff = !this.ctrlOff
            ctrl.$emit("ctrlOffEvent", this.ctrlOff)  // 通过中央事件总线触发自定义事件
        }
    }
}


</script>

<style lang="less" scoped>
.hader{
  width: 100%;
  height: 38px;
  position: absolute;
  top: 0;
  left: 0;
  font-size: 14px;
  background: #2bb8aa;
  z-index: 20;
  .title{
    text-align: center;
    font-weight: 560;
    line-height: 38px;
    color: #fff;
  }
  .logo{
    display: inline-block;
    width: 38px;
    height: 38px;
    background: url(./colr.png);
    position: absolute;
    right: 0;
    top: 0;
    background-size: 26px 26px;
    background-repeat: no-repeat;
    background-position: center;
  }
}

</style>